package com.sky.mapper;

import com.sky.entity.ShoppingCart;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.DeleteMapping;

import java.util.ArrayList;
import java.util.List;

@Mapper
public interface ShoppingCartMapper {
    List<ShoppingCart> selectById(ShoppingCart shoppingCart);

    @Update("update shopping_cart set number = #{number} where id = #{id};")
    void update(ShoppingCart shoppingCart);

    void insert(ShoppingCart shoppingCart);


    void deleteAll(Long userId);

    void delete(Long userId);

    void insertBatch(ArrayList<ShoppingCart> shoppingCarts);
}
